<?php if (!defined('THINK_PATH')) exit();?>

<script type="text/javascript">
	function check_form()
	{
		if($("input[name='money']").val()=='')
		{
			alert("金额不能为空");
			return false;
		}
		if(($("input[name='money']").val()!=''&&isNaN($("input[name='money']").val()))||parseFloat($("input[name='money']").val())<=0)
		{
			alert("金额有误");
			return false;
		}
		
		if(parseFloat($("input[name='money']").val())>parseFloat($("input[name='remain_money']").val()))
		{
			alert("筹款发放超额");
			return false;
		}
		
		return true;
	}
</script>
<div class="main">
<div class="main_title"><?php echo ($deal_info["name"]); ?> 筹款发放</div>
<div class="blank5"></div>
<div class="main_title" style="font-size:12px; font-weight:normal;">
实收<?php echo (format_price($deal_info["support_amount"])); ?>
<?php if($deal_info['delivery_fee_amount'] > 0): ?>(含运费<?php echo (format_price($deal_info["delivery_fee_amount"])); ?>)<?php endif; ?>
 - 网站佣金<?php echo (format_price($deal_info["commission"])); ?>
 = 应发筹金总额<?php echo (format_price($deal_info["pay_amount"])); ?>

已发筹金<?php echo (format_price($paid_money)); ?>

剩余筹金<?php echo (format_price($remain_money)); ?>
</div>
<div class="blank5"></div>
<form name="edit" action="__APP__" method="post" enctype="multipart/form-data" onsubmit="return check_form();">
<table class="form" cellpadding=0 cellspacing=0>
	<tr>
		<td colspan=2 class="topTd"></td>
	</tr>
	<tr>
		<td class="item_title">发放金额:</td>
		<td class="item_input"><input type="text" class="textbox require" name="money" />
		<input type="hidden" name="remain_money" value="<?php echo ($remain_money); ?>" />
		<span class='tip_span'>[<?php echo L("INCHARGE_USER_MONEY_TIP");?>]</span>
		</td>
	</tr>
	
	<tr>
		<td class="item_title">备注:</td>
		<td class="item_input"><input type="text" class="textbox" name="log_info" style="width:400px;" />
		</td>
	</tr>
	<tr>
		<td class="item_title">&nbsp;</td>
		<td class="item_input">
			<!--隐藏元素-->
			<input type="hidden" name="id" value="<?php echo ($deal_info["id"]); ?>" />
			<input type="hidden" name="<?php echo conf("VAR_MODULE");?>" value="Deal" />
			<input type="hidden" name="<?php echo conf("VAR_ACTION");?>" value="save_pay_log" />
			<!--隐藏元素-->
			<input type="submit" class="button" value="<?php echo L("OK");?>" />
			<input type="reset" class="button" value="<?php echo L("RESET");?>" />
		</td>
	</tr>
	<tr>
		<td colspan=2 class="bottomTd"></td>
	</tr>
</table>	 
</form>
</div>